TRAN_TOPIC_PROMPT: str = """
You are an expert in survey writing who wants to write a overall survey about "{topic}".\n\
You need to generate a concise title for the survey in English.\n\
The title should be simple and directly match the topic without adding extra scope or context.\n\
For example, if the topic is "Loss Functions", the title should be "A Survey of Loss Functions" rather than "A Survey of Loss Functions in Machine Learning".\n\

Return the title in the format:
<format>
Title: [TITLE OF THE SURVEY]
</format>
Only return the title without any other information:
"""

ROUGH_OUTLINE_PROMPT: str = """
You want to write a comprehensive academic survey about "{topic}".\n\
You are provided with a list of papers related to the topic below:\n\
---
{papers}
---

Requirements:
1. The outline should contain a title and exactly {sections_num_range} sections
2. Each section must have {subsections_num_range} subsections
3. Each section and subsection must follow with a brief description
4. The title should be academic, like "A Survey on Loss Functions in Deep Learning"
5. The sections should follow academic style, starting with "1. Introduction"
6. The outline must cover the core aspects of the topic comprehensively
7. The outline should be based on and supported by the provided papers

Return in the format:
<format>
Title: [ACADEMIC TITLE OF THE SURVEY]

Section 1: [NAME OF SECTION 1]
Description 1: [BRIEF DESCRIPTION OF SECTION 1]
Subsection 1-1: [NAME OF SUBSECTION 1-1]
SubDescription 1-1: [DESCRIPTION OF SUBSECTION 1-1]
Subsection 1-2: [NAME OF SUBSECTION 1-2]
SubDescription 1-2: [DESCRIPTION OF SUBSECTION 1-2]
... ({subsections_num_range} subsections)

Section 2: [NAME OF SECTION 2]
Description 2: [BRIEF DESCRIPTION OF SECTION 2]
Subsection 2-1: [NAME OF SUBSECTION 2-1]
SubDescription 2-1: [DESCRIPTION OF SUBSECTION 2-1]
... ({subsections_num_range} subsections)

... ({sections_num_range} sections total)
</format>

Remember:
- Maintain exactly {sections_num_range} main sections
- Each section must have {subsections_num_range} subsections
- Keep descriptions concise but informative
- Follow academic writing style
- Base the outline on the provided papers
"""

CLEAN_PAPER_PROMPT: str = """
Extract key content (max 150 words) from the paper that is most relevant to the survey topic. Focus on:
- Main findings and methods
- Key results and conclusions

Keep original text unchanged. Return "no_output_str" if irrelevant.

> Topic: {topic}
> Content:
>>>
{context}
>>>
Extracts:
"""

ROUGH_OUTLINE_PROMPT_V0: str = """
You want to write a comprehensive academic survey about "{topic}".\n\

Requirements:
1. The outline should contain a title and exactly {sections_num_range} sections
2. Each section must have {subsections_num_range} subsections
3. Each section and subsection must follow with a brief description
4. The title should be academic, like "A Survey on Loss Functions in Deep Learning"
5. The sections should follow academic style, starting with "1. Introduction"
6. The outline must cover the core aspects of the topic comprehensively

Return in the format:
<format>
Title: [ACADEMIC TITLE OF THE SURVEY]

Section 1: [NAME OF SECTION 1]
Description 1: [BRIEF DESCRIPTION OF SECTION 1]
Subsection 1-1: [NAME OF SUBSECTION 1-1]
SubDescription 1-1: [DESCRIPTION OF SUBSECTION 1-1]
Subsection 1-2: [NAME OF SUBSECTION 1-2]
SubDescription 1-2: [DESCRIPTION OF SUBSECTION 1-2]
... ({subsections_num_range} subsections)

Section 2: [NAME OF SECTION 2]
Description 2: [BRIEF DESCRIPTION OF SECTION 2]
Subsection 2-1: [NAME OF SUBSECTION 2-1]
SubDescription 2-1: [DESCRIPTION OF SUBSECTION 2-1]
... ({subsections_num_range} subsections)

... ({sections_num_range} sections total)
</format>

Remember:
- Maintain exactly {sections_num_range} main sections
- Each section must have {subsections_num_range} subsections
- Keep descriptions concise but informative
- Follow academic writing style
"""


UMULTI_QUERY_PROMPT: str = """
Please generate 1~2 synonymous or closely related search terms in English for the topic [{topic}]. These search terms should be semantically similar to capture papers discussing the same concept using different terminology.

For example, if the topic is "neural networks", related terms could be "artificial neural networks, connectionist systems, neural nets".

Please return in the following format:
query1, query2
"""


MERGING_OUTLINE_PROMPT = """
You are an expert in computer science tasked with writing a comprehensive survey about {topic}.\n\
Below are several candidate outlines for your reference:\n\
<all_outlines>
{outlines}
</all_outlines/>

Your task is to generate a final, comprehensive outline based on these candidates. Please note:

1. Carefully analyze the strengths of each candidate outline:
   - Identify unique and important sections from each outline
   - Note complementary perspectives between different outlines
   - Preserve valuable insights and details

2. Integration principles:
   - Ensure no important topics are omitted
   - Organize related content logically, avoiding redundancy
   - Balance comprehensiveness with logical flow
   - Maintain clear hierarchical relationships and coherence between sections

3. Optimization requirements:
   - Merge related sections for a clearer structure
   - Make section descriptions accurate, concise yet informative
   - Ensure subsections cover all important aspects of the topic

Return in the format:
<format>
Title: [ACADEMIC TITLE OF THE SURVEY]

Section 1: [NAME OF SECTION 1]
Description 1: [BRIEF DESCRIPTION OF SECTION 1]
Subsection 1-1: [NAME OF SUBSECTION 1-1]
SubDescription 1-1: [DESCRIPTION OF SUBSECTION 1-1]
Subsection 1-2: [NAME OF SUBSECTION 1-2]
SubDescription 1-2: [DESCRIPTION OF SUBSECTION 1-2]
... ({subsections_num_range} subsections)

Section 2: [NAME OF SECTION 2]
Description 2: [BRIEF DESCRIPTION OF SECTION 2]
Subsection 2-1: [NAME OF SUBSECTION 2-1]
SubDescription 2-1: [DESCRIPTION OF SUBSECTION 2-1]
... ({subsections_num_range} subsections)

... ({sections_num_range} sections total)
</format>

Remember:
- Maintain exactly {sections_num_range} main sections
- Each section must have {subsections_num_range} subsections
- Keep descriptions concise but informative
- Follow academic writing style
- Utilize the best content from all candidate outlines
- The final outline should be more comprehensive and systematic than any individual outline
"""


# 完整的目录结构， 我当前要写的目录位置， 参考论文
SUBSECTION_WRITING_PROMPT = """
You are an expert in computer science tasked with writing a comprehensive survey titled "{survey_title}".\n\
Below is the complete outline of your survey:\n\
<outline>
{outline}
</outline>

{paper_chunks_section}

Your task is to write detailed content for the following subsection:
Section: {section_name}
Subsection: {subsection_name}
Description: {subsection_description}

Requirements:
1. Content length must exceed {min_words} words
2. Follow academic writing style and maintain technical accuracy
3. only return content
4. {citation_requirements}
"""
